Fix oXs_configurator
[openXsensor.git] / oXs_Configurator / Python 37 Sources / oxsConfig.py
blobbf2a204557a26b185d2e1c1f49a0630bd89523ba
1 from tkinter import StringVar , Tk , W ,E , S , BOTH, HIDDEN, DoubleVar , Spinbox , IntVar , filedialog
2 from tkinter import ttk
3 from tkinter import messagebox
5 #from impExp import *
6 import configparser
8 #from oxsConfigurator import protocolChanged
9 #from oxsPpm import ppmTypeChanged
11 configUploadFileName = None
13 config = configparser.ConfigParser()
14 config.add_section("Main")
15 config.add_section("Ppm")
16 config.add_section("Imu")
17 config.add_section("Magnet")
18 config.add_section("Vario")
19 config.add_section("Airspeed")
20 config.add_section("Voltage")
21 config.add_section("Current")
22 config.add_section("Ads")
23 config.add_section("Flow")
24 config.add_section("Rpm")
25 config.add_section("Gps")
26 config.add_section("Memory")
27 config.add_section("AddFields")
28 config.add_section("Frsky")
29 config.add_section("Multiplex")
30 config.add_section("Hott")
31 config.add_section("Jeti")
33 def generateOxsConfig():
34 f=open("oXs_config_basic.h" , 'w')
35 fa=open("oXs_config_advanced.h" , 'w')
36 f.write("#ifndef OXS_CONFIG_BASIC_h\n")
37 f.write("#define OXS_CONFIG_BASIC_h\n")
38 f.write("\n")
39 fa.write("#ifndef OXS_CONFIG_ADVANCED_h\n")
40 fa.write("#define OXS_CONFIG_ADVANCED_h\n")
41 fa.write("\n")
42 fa.write(f"#define PIN_SERIALTX {pinToRxVar.get()}\n")
43 f.write(f"\n#define PROTOCOL {protocolVar.get()}\n\n")
44 if (protocolVar.get() == 'FRSKY_SPORT' or
45 protocolVar.get() == 'FRSKY_SPORT_HUB' or
46 protocolVar.get() == 'FRSKY_HUB') :
47 if frskyVfasVar.get() != 'Not sent':
48 f.write(f"#define VFAS_SOURCE {frskyVfasVar.get()}\n")
49 if frskyFuelVar.get() != 'Not sent':
50 f.write(f"#define FUEL_SOURCE {frskyFuelVar.get()}\n")
51 if frskyA3Var.get() != 'Not sent':
52 f.write(f"#define A3_SOURCE {frskyA3Var.get()}\n")
53 if frskyA4Var.get() != 'Not sent':
54 f.write(f"#define A4_SOURCE {frskyA4Var.get()}\n")
55 if frskyAccxVar.get() != 'Not sent':
56 f.write(f"#define ACCX_SOURCE {frskyAccxVar.get()}\n")
57 if frskyAccyVar.get() != 'Not sent':
58 f.write(f"#define ACCY_SOURCE {frskyAccyVar.get()}\n")
59 if frskyAcczVar.get() != 'Not sent':
60 f.write(f"#define ACCZ_SOURCE {frskyAcczVar.get()}\n")
61 if frskyT1Var.get() != 'Not sent':
62 f.write(f"#define T1_SOURCE {frskyT1Var.get()}\n")
63 if frskyT2Var.get() != 'Not sent':
64 f.write(f"#define T2_SOURCE {frskyT2Var.get()}\n")
66 if protocolVar.get() == 'FRSKY_SPORT' or protocolVar.get() == 'FRSKY_SPORT_HUB':
67 fa.write("\n#define DATA_ID_VARIO 0x00\n")
68 fa.write("#define DATA_ID_FLVSS 0xA1\n")
69 fa.write("#define DATA_ID_FAS 0x22\n")
70 fa.write("#define DATA_ID_GPS 0x83\n")
71 fa.write("#define DATA_ID_RPM 0xE4\n")
72 fa.write("#define DATA_ID_ACC 0x67\n")
73 fa.write("#define DATA_ID_TX 0x0D\n")
75 if protocolVar.get() == 'JETI':
76 if jetiVoltageSourceVar.get() != 'Not sent':
77 f.write(f"#define VOLTAGE_SOURCE {jetiVoltageSourceVar.get()}\n")
78 if jetiTemperatureSourceVar.get() != 'Not sent':
79 f.write(f"#define TEMPERATURE_SOURCE {jetiTemperatureSourceVar.get()}\n")
81 if protocolVar.get() == 'HOTT':
82 if hottCellUndervoltageVar.get() > 0:
83 f.write(f"#define CELL_UNDERVOLTAGE_WARNING {hottCellUndervoltageVar.get()}\n")
84 if hottBattery1SourceVar.get() != 'Not sent':
85 f.write(f"#define BATTERY_1_SOURCE {hottBattery1SourceVar.get()}\n")
86 if hottBattery2SourceVar.get() != 'Not sent':
87 f.write(f"#define BATTERY_2_SOURCE {hottBattery2SourceVar.get()}\n")
88 if hottMainBatterySourceVar.get() != 'Not sent':
89 f.write(f"#define MAIN_BATTERY_SOURCE {hottMainBatterySourceVar.get()}\n")
90 if hottT1SourceVar.get() != 'Not sent':
91 f.write(f"#define TEMPERATURE_1_SOURCE {hottT1SourceVar.get()}\n")
92 if hottT2SourceVar.get() != 'Not sent':
93 f.write(f"#define TEMPERATURE_2_SOURCE {hottT2SourceVar.get()}\n")
95 if protocolVar.get() == 'MULTIPLEX':
96 if (multiplexLine1Var.get() != 'Not sent') or (multiplexLine2Var.get() != 'Not sent') or (multiplexLine3Var.get() != 'Not sent') or \
97 (multiplexLine4Var.get() != 'Not sent') or (multiplexLine5Var.get() != 'Not sent') or (multiplexLine6Var.get() != 'Not sent'):
98 f.write("#define SETUP_MULTIPLEX_DATA_TO_SEND ")
99 firstLine = True
100 if multiplexLine1Var.get() != 'Not sent':
101 firstLine = False
102 f.write("\\")
103 f.write(f"\n 1, {multiplexLine1Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
104 if multiplexLine2Var.get() != 'Not sent':
105 if firstLine == False:
106 f.write(" , ")
107 else:
108 firstLine = False
109 f.write("\\")
110 f.write(f"\n 2, {multiplexLine2Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
111 if multiplexLine3Var.get() != 'Not sent':
112 if firstLine == False:
113 f.write(" , ")
114 else:
115 firstLine = False
116 f.write("\\")
117 f.write(f"\n 3, {multiplexLine3Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
118 if multiplexLine4Var.get() != 'Not sent':
119 if firstLine == False:
120 f.write(" , ")
121 else:
122 firstLine = False
123 f.write("\\")
124 f.write(f"\n 4, {multiplexLine4Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
125 if multiplexLine5Var.get() != 'Not sent':
126 if firstLine == False:
127 f.write(" , ")
128 else:
129 firstLine = False
130 f.write("\\")
131 f.write(f"\n 5, {multiplexLine5Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
132 if multiplexLine6Var.get() != 'Not sent':
133 if firstLine == False:
134 f.write(" , ")
135 else:
136 firstLine = False
137 f.write("\\")
138 f.write(f"\n 6, {multiplexLine6Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
139 if multiplexLine7Var.get() != 'Not sent':
140 if firstLine == False:
141 f.write(" , ")
142 else:
143 firstLine = False
144 f.write("\\")
145 f.write(f"\n 7, {multiplexLine7Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
146 if multiplexLine8Var.get() != 'Not sent':
147 if firstLine == False:
148 f.write(" , ")
149 else:
150 firstLine = False
151 f.write("\\")
152 f.write(f"\n 8, {multiplexLine8Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
153 if multiplexLine9Var.get() != 'Not sent':
154 if firstLine == False:
155 f.write(" , ")
156 else:
157 firstLine = False
158 f.write("\\")
159 f.write(f"\n 9, {multiplexLine9Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
160 f.write("\n")
161 else:
162 messagebox.showwarning("Warning","Generated files will be unvalid:\n for Multiplex protocol, you must specify the field(s) to be sent")
164 if addFieldsExist.get() == "On":
165 if fillTest1VarioTemperatureVar.get() == "On":
166 fa.write("\n#define FILL_TEST_1_VARIO_TEMP\n")
167 if fillTest2VarioTemperatureVar.get() == "On":
168 fa.write("\n#define FILL_TEST_2_VARIO_TEMP\n")
169 if fillTest3VarioTemperatureVar.get() == "On":
170 fa.write("\n#define FILL_TEST_3_VARIO_TEMP\n")
171 if fillTest3ExpectedAltitudeVar.get() == "On":
172 fa.write("\n#define FILL_TEST_3_WITH_EXPECTED_ALT\n")
173 fa.write(f"\n#define EXPECTED_ALT_AT_SEC {str(expAltTimeVar.get())}\n")
174 if fillTest123LinearAccVar.get() == "On":
175 fa.write("\n#define FILL_TEST_1_2_3_WITH_LINEAR_ACC\n")
176 if fillTest12VspeedAltVar.get() == "On":
177 fa.write("\n#define FILL_TEST_1_2_WITH_VSPEED_AND_ALT_FROM_SECOND_VARIO\n")
178 if fillTest1DteVar.get() == "On":
179 fa.write("\n#define FILL_TEST_1_WITH_DTE\n")
180 if fillTest2PpmAirspeedCompVar.get() == "On":
181 fa.write("\n#define FILL_TEST_2_WITH_PPM_AIRSPEED_COMPENSATION\n")
182 if fillTest1YawRateVar.get() == "On":
183 fa.write("\n#define FILL_TEST_1_WITH_YAWRATE\n")
184 if fillTest1HeadingVar.get() == "On":
185 fa.write("\n#define FILL_TEST1_WITH_HEADING_FROM_MAGNETOMETER\n")
186 if fillTest123FlowVar.get() == "On":
187 fa.write("\n#define FILL_TEST_1_2_3_WITH_FLOW_SENSOR_CONSUMPTION\n")
188 if fillTest1GpsNbrSatVar.get() == "On":
189 fa.write("\n#define FILL_TEST1_WITH_GPS_NUMBER_OF_SAT\n")
190 if fillTest2GpsHdopVar.get() == "On":
191 fa.write("\n#define FILL_TEST2_WITH_GPS_HDOP\n")
193 if ppmExist.get() == "On":
194 if ppmTypeVar.get() == 'Rx chanel':
195 fa.write(f"\n#define PIN_PPM {str(ppmPinVar.get())}\n")
196 fa.write(f"#define PPM_MIN_100 {str(ppmForMin100Var.get())}\n")
197 fa.write(f"#define PPM_PLUS_100 {str(ppmForPlus100Var.get())}\n")
198 else:
199 fa.write("\n#define PPM_VIA_SPORT \n")
201 if persistentExist.get() == "On":
202 f.write("\n#define SAVE_TO_EEPROM YES\n")
203 f.write(f"\n#define PIN_PUSHBUTTON {str(pushButtPinVar.get())}\n")
204 else:
205 f.write("\n#define SAVE_TO_EEPROM NO\n")
207 if varioExist.get() == "On":
208 f.write(f"#define FIRST_BARO_SENSOR_USE {varioTypeVar.get()}\n")
209 if varioTypeVar.get() == 'BMP280':
210 fa.write("#define BMP280_ADR 0x76\n")
211 f.write(f"#define VSPEED_SOURCE {varioSourceVar.get()}\n")
212 if secondBaroExist.get() == 'On':
213 fa.write("\n#define SECOND_BARO_SENSOR_USE MS5611\n")
214 else:
215 fa.write("\n#define SECOND_BARO_SENSOR_USE NO_BARO\n")
216 fa.write("\n#define SENSITIVITY_MIN 80\n")
217 fa.write("#define SENSITIVITY_MAX 300\n")
218 fa.write("#define SENSITIVITY_MIN_AT 100\n")
219 fa.write("#define SENSITIVITY_MAX_AT 1000\n")
220 if ppmExist.get() == "On":
221 fa.write("\n#define SENSITIVITY_MIN_AT_PPM 10\n")
222 fa.write("#define SENSITIVITY_MAX_AT_PPM 40\n")
223 fa.write("#define SENSITIVITY_PPM_MIN 20\n")
224 fa.write("#define SENSITIVITY_PPM_MAX 100\n")
225 fa.write(f"\n#define VARIOHYSTERESIS {str(varioHysteresisVar.get())}\n")
226 if analogVarioExist.get() == "On":
227 fa.write(f"\n#define PIN_ANALOG_VSPEED {varioAnalogPinVar.get()}\n")
228 fa.write(f"#define ANALOG_VSPEED_MIN {varioAnalogMinVar.get()}\n")
229 fa.write(f"#define ANALOG_VSPEED_MAX {varioAnalogMaxVar.get()}\n")
230 else:
231 f.write("#define FIRST_BARO_SENSOR_USE NO_BARO\n")
233 if airspeedExist.get() == "On":
234 f.write(f"#define AIRSPEED_SENSOR_USE {airspeedTypeVar.get()}\n")
235 if airspeedAtSea15CVar == "On":
236 fa.write("\n#define AIRSPEED_AT_SEA_LEVEL_AND_15C\n")
237 if airspeedInKmhVar == "On":
238 fa.write("\n#define AIRSPEED_IN_KMH\n")
239 fa.write(f"\n#define AIRSPEED_RESET_AT_PPM {airspeedResetAtPpmVar.get()}\n")
240 fa.write(f"\n#define COMPENSATION_MIN_AT_PPM {airspeedCompMinAtPpmVar.get()}\n")
241 fa.write(f"\n#define COMPENSATION_MAX_AT_PPM {airspeedCompMaxAtPpmVar.get()}\n")
242 fa.write(f"\n#define COMPENSATION_PPM_MIN {airspeedCompMinVar.get()}\n")
243 fa.write(f"\n#define COMPENSATION_PPM_MAX {airspeedCompMaxVar.get()}\n")
244 else:
245 f.write("\n#define AIRSPEED_SENSOR_USE NO_AIRSPEED\n")
247 if voltageExist.get() == "On":
248 f.write("\n#define ARDUINO_MEASURES_VOLTAGES YES\n")
249 f.write(f"#define NUMBEROFCELLS {voltNumberOfCellsVar.get()}\n")
250 if voltReferenceVar.get() == "Internal":
251 fa.write("\n#define USE_INTERNAL_REFERENCE\n")
252 elif voltReferenceVar.get() == "External":
253 fa.write("\n#define USE_EXTERNAL_REFERENCE\n")
254 fa.write(f"\n#define REFERENCE_VOLTAGE {str(voltRefValueVar.get())}\n")
255 else:
256 fa.write(f"\n#define REFERENCE_VOLTAGE {str(voltRefValueVar.get())}\n")
257 fa.write(f"\n#define PIN_VOLTAGE ")
258 if volt1Exist.get() == 'On':
259 fa.write(f" {volt1PinVar.get()} , ")
260 else:
261 fa.write("8 , ")
262 if volt2Exist.get() == 'On':
263 fa.write(f" {volt2PinVar.get()} , ")
264 else:
265 fa.write("8 , ")
266 if volt3Exist.get() == 'On':
267 fa.write(f" {volt3PinVar.get()} , ")
268 else:
269 fa.write("8 , ")
270 if volt4Exist.get() == 'On':
271 fa.write(f" {volt4PinVar.get()} , ")
272 else:
273 fa.write("8 , ")
274 if volt5Exist.get() == 'On':
275 fa.write(f" {volt5PinVar.get()} , ")
276 else:
277 fa.write("8 , ")
278 if volt6Exist.get() == 'On':
279 fa.write(f" {volt6PinVar.get()} \n")
280 else:
281 fa.write("8\n")
282 fa.write((f"#define RESISTOR_TO_GROUND {volt1RgVar.get()} , " +
283 f"{volt2RgVar.get()} , {volt3RgVar.get()} , {volt4RgVar.get()} , " +
284 f"{volt5RgVar.get()} , {volt6RgVar.get()}\n"))
285 fa.write((f"#define RESISTOR_TO_VOLTAGE {volt1RvVar.get()} , " +
286 f"{volt2RvVar.get()} , {volt3RvVar.get()} , {volt4RvVar.get()} , " +
287 f"{volt5RvVar.get()} , {volt6RvVar.get()}\n"))
288 fa.write((f"#define OFFSET_VOLTAGE {volt1OffsetVar.get()} , " +
289 f"{volt2OffsetVar.get()} , {volt3OffsetVar.get()} , {volt4OffsetVar.get()} , " +
290 f"{volt5OffsetVar.get()} , {volt6OffsetVar.get()}\n"))
291 fa.write((f"#define SCALE_VOLTAGE {volt1ScaleVar.get()} , " +
292 f"{volt2ScaleVar.get()} , {volt3ScaleVar.get()} , {volt4ScaleVar.get()} , " +
293 f"{volt5ScaleVar.get()} , {volt6ScaleVar.get()}\n"))
294 else:
295 f.write("\n#define ARDUINO_MEASURES_VOLTAGES NO\n")
297 if currentExist.get() == "On":
298 f.write("\n#define ARDUINO_MEASURES_A_CURRENT YES\n")
299 fa.write(f"\n#define PIN_CURRENTSENSOR {currentPinVar.get()}\n")
300 fa.write(f"#define MVOLT_AT_ZERO_AMP {str(currentMvoltAt0Var.get())}\n")
301 fa.write(f"#define MVOLT_PER_AMP {str(currentMvoltPerAmpVar.get())}\n")
302 fa.write(f"#define RESISTOR_TO_GROUND_FOR_CURRENT {str(currentRgVar.get())}\n")
303 fa.write(f"#define RESISTOR_TO_CURRENT_SENSOR {str(currentRcVar.get())}\n")
304 else:
305 f.write("\n#define ARDUINO_MEASURES_A_CURRENT NO\n")
307 if adcExist.get() == "On":
308 if (Adc0TypeVar.get() != "ADS_OFF") or (Adc1TypeVar.get() != "ADS_OFF") or (Adc2TypeVar.get() != "ADS_OFF") or (Adc3TypeVar.get() != "ADS_OFF"):
309 f.write("\n#define AN_ADS1115_IS_CONNECTED YES\n")
310 fa.write(f"\n#define ADS_MEASURE {Adc0TypeVar.get()}, {Adc1TypeVar.get()}, {Adc2TypeVar.get()}, {Adc3TypeVar.get()}\n")
311 fa.write(f"#define ADS_FULL_SCALE_VOLT {Adc0FsVar.get()}, {Adc1FsVar.get()}, {Adc2FsVar.get()}, {Adc3FsVar.get()}\n")
312 fa.write(f"#define ADS_OFFSET {str(Adc0OffVar.get())}, {str(Adc1OffVar.get())}, {str(Adc2OffVar.get())}, {str(Adc3OffVar.get())}\n")
313 fa.write(f"#define ADS_SCALE {str(Adc0ScVar.get())}, {str(Adc1ScVar.get())}, {str(Adc2ScVar.get())}, {str(Adc3ScVar.get())}\n")
314 fa.write(f"#define ADS_RATE {Adc0CrVar.get()}, {Adc1CrVar.get()}, {Adc2CrVar.get()}, {Adc3CrVar.get()}\n")
315 if Adc0AvgVar.get()<1:
316 Adc0AvgVar.set(1)
317 if Adc1AvgVar.get()<1:
318 Adc1AvgVar.set(1)
319 if Adc2AvgVar.get()<1:
320 Adc2AvgVar.set(1)
321 if Adc3AvgVar.get()<1:
322 Adc3AvgVar.set(1)
323 if Adc0AvgVar.get()>254:
324 Adc0AvgVar.set(254)
325 if Adc1AvgVar.get()>254:
326 Adc1AvgVar.set(254)
327 if Adc2AvgVar.get()>254:
328 Adc2AvgVar.set(254)
329 if Adc3AvgVar.get()>254:
330 Adc3AvgVar.set(254)
331 fa.write(f"#define ADS_AVERAGING_ON {str(Adc0AvgVar.get())}, {str(Adc1AvgVar.get())}, {str(Adc2AvgVar.get())}, {str(Adc3AvgVar.get())}\n")
332 if AdcCurrVar.get() != "NO":
333 fa.write(f"#define ADS_CURRENT_BASED_ON {AdcCurrVar.get()}\n")
334 if AdcSpVar.get() != "NO":
335 fa.write(f"#define ADS_AIRSPEED_BASED_ON {AdcSpVar.get()}\n")
336 else:
337 f.write("\n#define AN_ADS1115_IS_CONNECTED NO\n")
338 else:
339 f.write("\n#define AN_ADS1115_IS_CONNECTED NO\n")
341 if rpmExist.get() == "On":
342 f.write("\n#define CALCULATE_RPM YES\n")
343 fa.write(f"\n#define PULSES_PER_ROTATION {pulsesPerRotationVar.get()}\n")
344 else:
345 f.write("\n#define CALCULATE_RPM NO\n")
347 if gpsExist.get() == "On":
348 f.write("\n#define A_GPS_IS_CONNECTED YES\n")
349 if gpsTimeExist.get() == 'On':
350 fa.write("\n#define GPS_TRANSMIT_TIME\n")
351 if gps3dExist.get() == 'On':
352 fa.write("\n#define GPS_SPEED_3D\n")
353 fa.write(f"#define GPS_REFRESH_RATE {gpsRateVar.get()}\n")
354 else:
355 fa.write(f"\n#define GPS_REFRESH_RATE {gpsRateVar.get()}\n")
356 else:
357 f.write("\n#define A_GPS_IS_CONNECTED NO\n")
359 if imuExist.get() == "On":
360 f.write("\n#define A_MPU6050_IS_CONNECTED YES\n")
361 fa.write(f"\n#define PIN_INT_6050 {str(imuPinVar.get())}\n")
362 if imuDisplayOffset.get() == "On":
363 fa.write("\n#define DISPLAY_ACC_OFFSET\n")
364 else:
366 fa.write(f"#define ACC_OFFSET_X {str(imuOffsetXVar.get())}\n")
367 fa.write(f"#define ACC_OFFSET_Y {str(imuOffsetYVar.get())}\n")
368 fa.write(f"#define ACC_OFFSET_Z {str(imuOffsetZVar.get())}\n")
369 else:
370 f.write("\n#define A_MPU6050_IS_CONNECTED NO\n")
372 if magnetExist.get() == "On":
373 if GeneratemagCalData.get() == "On":
374 fa.write("\n#define GENERATE_MAG_CALIBRATION_DATA\n")
375 else:
376 fa.write(f"#define XMAG_OFFSET {str(xMagOffsetVar.get())}\n")
377 fa.write(f"#define YMAG_OFFSET {str(yMagOffsetVar.get())}\n")
378 fa.write(f"#define ZMAG_OFFSET {str(zMagOffsetVar.get())}\n")
379 fa.write(f"#define XXMAG_CORRECTION {str(xxMagCorrectionVar.get())}\n")
380 fa.write(f"#define XYMAG_CORRECTION {str(xyMagCorrectionVar.get())}\n")
381 fa.write(f"#define XZMAG_CORRECTION {str(xzMagCorrectionVar.get())}\n")
382 fa.write(f"#define YXMAG_CORRECTION {str(yxMagCorrectionVar.get())}\n")
383 fa.write(f"#define YYMAG_CORRECTION {str(yyMagCorrectionVar.get())}\n")
384 fa.write(f"#define YZMAG_CORRECTION {str(yzMagCorrectionVar.get())}\n")
385 fa.write(f"#define ZXMAG_CORRECTION {str(zxMagCorrectionVar.get())}\n")
386 fa.write(f"#define ZYMAG_CORRECTION {str(zyMagCorrectionVar.get())}\n")
387 fa.write(f"#define ZZMAG_CORRECTION {str(zzMagCorrectionVar.get())}\n")
388 f.write("\n#define CALCULATE_YAW_WITH_HMC5883 YES\n")
390 else:
391 f.write("\n#define CALCULATE_YAW_WITH_HMC5883 NO\n")
393 if flowExist.get() == "On":
394 f.write("\n#define A_FLOW_SENSOR_IS_CONNECTED YES\n")
395 fa.write(f"#define PULSES_PER_ML {str(flowPulsesmlVar.get())}\n")
396 fa.write(f"#define TANK_CAPACITY {str(flowTankCapVar.get())}\n")
397 fa.write(f"#define INIT_FLOW_PARAM {str(flowL1ValueVar.get())} , {str(flowL2ValueVar.get())} , {str(flowL3ValueVar.get())} , {str(flowL4ValueVar.get())} , {str(flowL1CorrVar.get())} , {str(flowL2CorrVar.get())} , {str(flowL3CorrVar.get())} , {str(flowL4CorrVar.get())}\n")
398 fa.write(f"##define FLOW_SENSOR_RESET_AT_PPM {str(flowPPMResetVar.get())}\n")
399 else:
400 f.write("\n#define A_FLOW_SENSOR_IS_CONNECTED NO\n")
402 if sequenceExist.get() == 'On':
403 if SeqOut1Var.get()=='1' or SeqOut2Var.get()=='1' or SeqOut3Var.get()=='1' or SeqOut4Var.get()=='1' or SeqOut5Var.get()=='1' or SeqOut6Var.get()=='1':
404 fa.write(f"#define SEQUENCE_OUTPUTS 0b{SeqOut6Var.get()}{SeqOut5Var.get()}{SeqOut4Var.get()}{SeqOut3Var.get()}{SeqOut2Var.get()}{SeqOut1Var.get()}\n")
405 fa.write(f"#define SEQUENCE_UNIT {str(SeqUnitVar.get())}\n")
406 if SeqTVar[0].get()!='0' and SeqTVar[0].get()!='':
407 fa.write("#define SEQUENCE_m100 ")
408 for y in range (0,25):
409 if SeqTVar[y*4].get()=='':
410 break
411 if y!=0:
412 fa.write(",")
413 fa.write(f"{SeqTVar[y*4].get()}, 0b{str(SeqB5Var[y*4].get())}{str(SeqB4Var[y*4].get())}{str(SeqB3Var[y*4].get())}{str(SeqB2Var[y*4].get())}{str(SeqB1Var[y*4].get())}{str(SeqB0Var[y*4].get())}")
414 fa.write("\n")
415 if SeqTVar[1].get()!='0' and SeqTVar[1].get()!='':
416 fa.write("#define SEQUENCE_0 ")
417 for y in range (0,25):
418 if SeqTVar[y*4+1].get()=='':
419 break
420 if y!=0:
421 fa.write(",")
422 fa.write(f"{SeqTVar[y*4+1].get()}, 0b{str(SeqB5Var[y*4+1].get())}{str(SeqB4Var[y*4+1].get())}{str(SeqB3Var[y*4+1].get())}{str(SeqB2Var[y*4+1].get())}{str(SeqB1Var[y*4+1].get())}{str(SeqB0Var[y*4+1].get())}")
423 fa.write("\n")
424 if SeqTVar[2].get()!='0' and SeqTVar[2].get()!='':
425 fa.write("#define SEQUENCE_100 ")
426 for y in range (0,25):
427 if SeqTVar[y*4+2].get()=='':
428 break
429 if y!=0:
430 fa.write(",")
431 fa.write(f"{SeqTVar[y*4+2].get()}, 0b{str(SeqB5Var[y*4+2].get())}{str(SeqB4Var[y*4+2].get())}{str(SeqB3Var[y*4+2].get())}{str(SeqB2Var[y*4+2].get())}{str(SeqB1Var[y*4+2].get())}{str(SeqB0Var[y*4+2].get())}")
432 fa.write("\n")
433 if voltageExist.get() == "On":
434 if SeqTVar[3].get()!='0' and SeqTVar[3].get()!='' and (SeqMinVoltVar.get()!=0 or SeqMinCellVar.get()!=0):
435 fa.write("#define SEQUENCE_LOW ")
436 for y in range (0,25):
437 if SeqTVar[y*4+3].get()=='':
438 break
439 if y!=0:
440 fa.write(",")
441 fa.write(f"{SeqTVar[y*4+3].get()}, 0b{str(SeqB5Var[y*4+3].get())}{str(SeqB4Var[y*4+3].get())}{str(SeqB3Var[y*4+3].get())}{str(SeqB2Var[y*4+3].get())}{str(SeqB1Var[y*4+3].get())}{str(SeqB0Var[y*4+3].get())}")
442 fa.write("\n")
443 if (SeqMinVoltVar.get()!=0):
444 fa.write(f"#define SEQUENCE_MIN_VOLT_1 {str(SeqMinVoltVar.get())}")
445 messagebox.showinfo("oXs configurator", "Be carefull you may need to modify oXs_config_advanced.h to set the voltage source for sequence")
446 if (SeqMinCellVar.get()!=0):
447 fa.write(f"#define SEQUENCE_MIN_CELL {str(SeqMinCellVar.get())}")
448 if locatorExist.get() == "On":
449 f.write("\n#define A_LOCATOR_IS_CONNECTED YES\n")
450 else:
451 f.write("\n#define A_LOCATOR_IS_CONNECTED NO\n")
455 f.write("\n#endif\n")
456 fa.write("\n#endif\n")
457 f.close()
458 fa.close()
459 messagebox.showinfo("oXs configurator", "Config files advanced and basic have been created")
461 def uploadConfig():
462 from oxsVoltage import voltReferenceChanged
463 print("Read config")
464 #global configUploadFileName
465 #configUploadFileName = filedialog.askopenfilename(initialdir="C:/Data/",
466 configUploadFileName = filedialog.askopenfilename(\
467 filetypes =(("Ini files", "*.ini"),("All files","*.*")),
468 title = "Choose a file."
470 #config.read('config.ini')
471 config.read(configUploadFileName)
472 ppmExist.set(value= config.get('Main', 'ppmExist'))
473 ppmChanged()
474 varioExist.set(value= config.get('Main', 'varioExist'))
475 varioChanged()
476 voltageExist.set(value = config.get("Main", "voltageExist"))
477 voltageChanged()
478 currentExist.set(value = config.get("Main", "currentExist"))
479 currentChanged()
480 gpsExist.set(value = config.get("Main", "gpsExist"))
481 gpsChanged()
482 airspeedExist.set(value= config.get("Main", "airspeedExist"))
483 airspeedChanged()
484 rpmExist.set(value= config.get("Main", "rpmExist"))
485 rpmChanged()
486 imuExist.set(value= config.get("Main", "imuExist"))
487 imuChanged()
488 magnetExist.set(value= config.get("Main", "magnetExist"))
489 magnetChanged()
490 flowExist.set(value= config.get("Main", "flowExist"))
491 flowChanged()
492 adcExist.set(value= config.get("Main", "adcExist"))
493 adcChanged()
494 sequenceExist.set(value= config.get("Main", "sequenceExist"))
495 sequenceChanged()
496 persistentExist.set(value= config.get("Main", "persistentExist"))
497 persistentChanged()
498 addFieldsExist.set(value= config.get("Main", "addFieldsExist"))
499 addFieldsChanged()
500 protocolVar.set(value= config.get("Main", "protocolVar"))
501 protocolChanged()
503 ppmTypeVar.set(value= config.get("Ppm", "ppmTypeVar"))
504 ppmTypeChanged()
505 ppmPinVar.set(value= config.getint("Ppm", "ppmPinVar"))
506 ppmForMin100Var.set(value= config.getint("Ppm", "ppmForMin100Var"))
507 ppmForPlus100Var.set(value= config.getint("Ppm", "ppmForPlus100Var"))
509 imuPinVar.set(value= config.getint("Imu", "imuPinVar"))
510 imuDisplayOffset.set(value= config.get("Imu", "imuDisplayOffset"))
511 imuOffsetXVar.set(value= config.getint("Imu", "imuOffsetXVar"))
512 imuOffsetYVar.set(value= config.getint("Imu", "imuOffsetYVar"))
513 imuOffsetZVar.set(value= config.getint("Imu", "imuOffsetZVar"))
515 GeneratemagCalData.set(value= config.get("Magnet", "GeneratemagCalData"))
516 xMagOffsetVar.set(value= config.getint("Magnet", "xMagOffsetVar"))
517 yMagOffsetVar.set(value= config.getint("Magnet", "yMagOffsetVar"))
518 zMagOffsetVar.set(value= config.getint("Magnet", "zMagOffsetVar"))
519 xxMagCorrectionVar.set(value= config.getfloat("Magnet", "xxMagCorrectionVar"))
520 xyMagCorrectionVar.set(value= config.getfloat("Magnet", "xyMagCorrectionVar"))
521 xzMagCorrectionVar.set(value= config.getfloat("Magnet", "xzMagCorrectionVar"))
522 yxMagCorrectionVar.set(value= config.getfloat("Magnet", "yxMagCorrectionVar"))
523 yyMagCorrectionVar.set(value= config.getfloat("Magnet", "yyMagCorrectionVar"))
524 yzMagCorrectionVar.set(value= config.getfloat("Magnet", "yzMagCorrectionVar"))
525 zxMagCorrectionVar.set(value= config.getfloat("Magnet", "zxMagCorrectionVar"))
526 zyMagCorrectionVar.set(value= config.getfloat("Magnet", "zyMagCorrectionVar"))
527 zzMagCorrectionVar.set(value= config.getfloat("Magnet", "zzMagCorrectionVar"))
529 pushButtPinVar.set(value= config.getint("Memory", "pushButtPinVar"))
531 varioTypeVar.set(value= config.get("Vario", "varioTypeVar"))
532 secondBaroExist.set(value= config.get("Vario", "secondBaroExist"))
533 varioSourceVar.set(value= config.get("Vario", "varioSourceVar"))
534 varioHysteresisVar.set(value= config.getint("Vario", "varioHysteresisVar"))
535 analogVarioExist.set(value= config.get("Vario", "analogVarioExist"))
536 analogVarioChanged()
537 varioAnalogPinVar.set(value= config.get("Vario", "varioAnalogPinVar"))
538 varioAnalogMinVar.set(value= config.getfloat("Vario", "varioAnalogMinVar"))
539 varioAnalogMaxVar.set(value= config.getfloat("Vario", "varioAnalogMaxVar"))
541 airspeedTypeVar.set(value= config.get("Airspeed", "airspeedTypeVar"))
542 airspeedAtSea15CVar.set(value= config.get("Airspeed", "airspeedAtSea15CVar"))
543 airspeedInKmhVar.set(value= config.get("Airspeed", "airspeedInKmhVar"))
544 airspeedResetAtPpmVar.set(value= config.getint("Airspeed", "airspeedResetAtPpmVar"))
545 airspeedCompMinAtPpmVar.set(value= config.getint("Airspeed", "airspeedCompMinAtPpmVar"))
546 airspeedCompMaxAtPpmVar.set(value= config.getint("Airspeed", "airspeedCompMaxAtPpmVar"))
547 airspeedCompMinVar.set(value= config.getint("Airspeed", "airspeedCompMinVar"))
548 airspeedCompMaxVar.set(value= config.getint("Airspeed", "airspeedCompMaxVar"))
550 volt1Exist.set(value= config.get("Voltage", "volt1Exist"))
551 volt2Exist.set(value= config.get("Voltage", "volt2Exist"))
552 volt3Exist.set(value= config.get("Voltage", "volt3Exist"))
553 volt4Exist.set(value= config.get("Voltage", "volt4Exist"))
554 volt5Exist.set(value= config.get("Voltage", "volt5Exist"))
555 volt6Exist.set(value= config.get("Voltage", "volt6Exist"))
556 volt1PinVar.set(value= config.get("Voltage", "volt1PinVar"))
557 volt2PinVar.set(value= config.get("Voltage", "volt2PinVar"))
558 volt3PinVar.set(value= config.get("Voltage", "volt3PinVar"))
559 volt4PinVar.set(value= config.get("Voltage", "volt4PinVar"))
560 volt5PinVar.set(value= config.get("Voltage", "volt5PinVar"))
561 volt6PinVar.set(value= config.get("Voltage", "volt6PinVar"))
562 volt1RgVar.set(value= config.getfloat("Voltage", "volt1RgVar"))
563 volt2RgVar.set(value= config.getfloat("Voltage", "volt2RgVar"))
564 volt3RgVar.set(value= config.getfloat("Voltage", "volt3RgVar"))
565 volt4RgVar.set(value= config.getfloat("Voltage", "volt4RgVar"))
566 volt5RgVar.set(value= config.getfloat("Voltage", "volt5RgVar"))
567 volt6RgVar.set(value= config.getfloat("Voltage", "volt6RgVar"))
568 volt1RvVar.set(value= config.getfloat("Voltage", "volt1RvVar"))
569 volt2RvVar.set(value= config.getfloat("Voltage", "volt2RvVar"))
570 volt3RvVar.set(value= config.getfloat("Voltage", "volt3RvVar"))
571 volt4RvVar.set(value= config.getfloat("Voltage", "volt4RvVar"))
572 volt5RvVar.set(value= config.getfloat("Voltage", "volt5RvVar"))
573 volt6RvVar.set(value= config.getfloat("Voltage", "volt6RvVar"))
574 volt1ScaleVar.set(value= config.getfloat("Voltage", "volt1ScaleVar"))
575 volt2ScaleVar.set(value= config.getfloat("Voltage", "volt2ScaleVar"))
576 volt3ScaleVar.set(value= config.getfloat("Voltage", "volt3ScaleVar"))
577 volt4ScaleVar.set(value= config.getfloat("Voltage", "volt4ScaleVar"))
578 volt5ScaleVar.set(value= config.getfloat("Voltage", "volt5ScaleVar"))
579 volt5ScaleVar.set(value= config.getfloat("Voltage", "volt6ScaleVar"))
580 volt1OffsetVar.set(value= config.getfloat("Voltage", "volt1OffsetVar"))
581 volt2OffsetVar.set(value= config.getfloat("Voltage", "volt2OffsetVar"))
582 volt3OffsetVar.set(value= config.getfloat("Voltage", "volt3OffsetVar"))
583 volt4OffsetVar.set(value= config.getfloat("Voltage", "volt4OffsetVar"))
584 volt5OffsetVar.set(value= config.getfloat("Voltage", "volt5OffsetVar"))
585 volt6OffsetVar.set(value= config.getfloat("Voltage", "volt6OffsetVar"))
586 voltReferenceVar.set(value= config.get("Voltage", "voltReferenceVar"))
587 voltRefValueVar.set(value= config.getfloat("Voltage", "voltRefValueVar"))
588 voltReferenceChanged()
591 currentPinVar.set(value= config.get("Current", "currentPinVar"))
592 currentMvoltAt0Var.set(value= config.getfloat("Current", "currentMvoltAt0Var"))
593 currentMvoltPerAmpVar.set(value= config.getfloat("Current", "currentMvoltPerAmpVar"))
594 currentRgVar.set(value= config.getfloat("Current", "currentRgVar"))
595 currentRcVar.set(value= config.getfloat("Current", "currentRcVar"))
597 flowPulsesmlVar.set(value= config.getint("Flow", "flowPulsesmlVar"))
598 flowTankCapVar.set(value= config.getint("Flow", "flowTankCapVar"))
599 flowL1ValueVar.set(value= config.getint("Flow", "flowL1ValueVar"))
600 flowL1CorrVar.set(value= config.getint("Flow", "flowL1CorrVar"))
601 flowL2ValueVar.set(value= config.getint("Flow", "flowL2ValueVar"))
602 flowL2CorrVar.set(value= config.getint("Flow", "flowL2CorrVar"))
603 flowL3ValueVar.set(value= config.getint("Flow", "flowL3ValueVar"))
604 flowL3CorrVar.set(value= config.getint("Flow", "flowL3CorrVar"))
605 flowL4ValueVar.set(value= config.getint("Flow", "flowL4ValueVar"))
606 flowL4CorrVar.set(value= config.getint("Flow", "flowL4CorrVar"))
607 flowPPMResetVar.set(value= config.getint("Flow", "flowPPMResetVar"))
609 pulsesPerRotationVar.set(value=config.get("Rpm","pulsesPerRotationVar"))
611 Adc0TypeVar.set(value= config.get("Ads", "Adc0TypeVar"))
612 Adc1TypeVar.set(value= config.get("Ads", "Adc1TypeVar"))
613 Adc2TypeVar.set(value= config.get("Ads", "Adc2TypeVar"))
614 Adc3TypeVar.set(value= config.get("Ads", "Adc3TypeVar"))
615 Adc0FsVar.set(value= config.get("Ads", "Adc0FsVar"))
616 Adc1FsVar.set(value= config.get("Ads", "Adc1FsVar"))
617 Adc2FsVar.set(value= config.get("Ads", "Adc2FsVar"))
618 Adc3FsVar.set(value= config.get("Ads", "Adc3FsVar"))
619 Adc0OffVar.set(value= config.getint("Ads", "Adc0OffVar"))
620 Adc1OffVar.set(value= config.getint("Ads", "Adc1OffVar"))
621 Adc2OffVar.set(value= config.getint("Ads", "Adc2OffVar"))
622 Adc3OffVar.set(value= config.getint("Ads", "Adc3OffVar"))
623 Adc0ScVar.set(value= config.getfloat("Ads", "Adc0ScVar"))
624 Adc1ScVar.set(value= config.getfloat("Ads", "Adc1ScVar"))
625 Adc2ScVar.set(value= config.getfloat("Ads", "Adc2ScVar"))
626 Adc3ScVar.set(value= config.getfloat("Ads", "Adc3ScVar"))
627 Adc0CrVar.set(value= config.get("Ads", "Adc0CrVar"))
628 Adc1CrVar.set(value= config.get("Ads", "Adc1CrVar"))
629 Adc2CrVar.set(value= config.get("Ads", "Adc2CrVar"))
630 Adc3CrVar.set(value= config.get("Ads", "Adc3CrVar"))
631 Adc0AvgVar.set(value= config.getint("Ads", "Adc0AvgVar"))
632 Adc1AvgVar.set(value= config.getint("Ads", "Adc1AvgVar"))
633 Adc2AvgVar.set(value= config.getint("Ads", "Adc2AvgVar"))
634 Adc3AvgVar.set(value= config.getint("Ads", "Adc3AvgVar"))
635 AdcCurrVar.set(value= config.get("Ads", "AdcCurrVar"))
636 AdcSpVar.set(value= config.get("Ads", "AdcSpVar"))
638 gps3dExist.set(value= config.get("Gps", "gps3dexist"))
639 gpsTimeExist.set(value= config.get("Gps", "gpstimeexist"))
640 gpsRateVar.set(value= config.getint("Gps", "gpsratevar"))
641 fillTest1VarioTemperatureVar.set(value= config.get("AddFields", "fillTest1VarioTemperatureVar"))
642 fillTest2VarioTemperatureVar.set(value= config.get("AddFields", "fillTest2VarioTemperatureVar"))
643 fillTest3VarioTemperatureVar.set(value= config.get("AddFields", "fillTest3VarioTemperatureVar"))
644 fillTest3ExpectedAltitudeVar.set(value= config.get("AddFields", "fillTest3ExpectedAltitudeVar"))
645 fillTest3ExpectedAltitudeChanged()
646 expAltTimeVar.set(value= config.getfloat("AddFields", "expAltTimeVar"))
647 fillTest123LinearAccVar.set(value= config.get("AddFields", "fillTest123LinearAccVar"))
648 fillTest12VspeedAltVar.set(value= config.get("AddFields", "fillTest12VspeedAltVar"))
649 fillTest1DteVar.set(value= config.get("AddFields", "fillTest1DteVar"))
650 fillTest2PpmAirspeedCompVar.set(value= config.get("AddFields", "fillTest2PpmAirspeedCompVar"))
651 fillTest1YawRateVar.set(value= config.get("AddFields", "fillTest1YawRateVar"))
652 fillTest1HeadingVar.set(value= config.get("AddFields", "fillTest1HeadingVar"))
653 fillTest123FlowVar.set(value= config.get("AddFields", "fillTest123FlowVar"))
654 fillTest1GpsNbrSatVar.set(value= config.get("AddFields", "fillTest1GpsNbrSatVar"))
655 fillTest2GpsHdopVar.set(value= config.get("AddFields", "fillTest2GpsHdopVar"))
657 frskyVfasVar.set(value= config.get("Frsky", "frskyVfasVar"))
658 frskyFuelVar.set(value= config.get("Frsky", "frskyFuelVar"))
659 frskyA3Var.set(value= config.get("Frsky", "frskyA3Var"))
660 frskyA4Var.set(value= config.get("Frsky", "frskyA4Var"))
661 frskyAccxVar.set(value= config.get("Frsky", "frskyAccxVar"))
662 frskyAccyVar.set(value= config.get("Frsky", "frskyAccyVar"))
663 frskyAcczVar.set(value= config.get("Frsky", "frskyAcczVar"))
664 frskyT1Var.set(value= config.get("Frsky", "frskyT1Var"))
665 frskyT2Var.set(value= config.get("Frsky", "frskyT2Var"))
667 multiplexLine1Var.set(value= config.get("Multiplex", "multiplexLine1Var"))
668 multiplexLine2Var.set(value= config.get("Multiplex", "multiplexLine2Var"))
669 multiplexLine3Var.set(value= config.get("Multiplex", "multiplexLine3Var"))
670 multiplexLine4Var.set(value= config.get("Multiplex", "multiplexLine4Var"))
671 multiplexLine5Var.set(value= config.get("Multiplex", "multiplexLine5Var"))
672 multiplexLine6Var.set(value= config.get("Multiplex", "multiplexLine6Var"))
673 multiplexLine7Var.set(value= config.get("Multiplex", "multiplexLine7Var"))
674 multiplexLine8Var.set(value= config.get("Multiplex", "multiplexLine8Var"))
675 multiplexLine9Var.set(value= config.get("Multiplex", "multiplexLine9Var"))
677 hottBattery1SourceVar.set(value= config.get("Hott", "hottBattery1SourceVar"))
678 hottBattery2SourceVar.set(value= config.get("Hott", "hottBattery2SourceVar"))
679 hottCellUndervoltageVar.set(value= config.getint("Hott", "hottCellUndervoltageVar"))
680 hottMainBatterySourceVar.set(value= config.get("Hott", "hottMainBatterySourceVar"))
681 hottT1SourceVar.set(value= config.get("Hott", "hottT1SourceVar"))
682 hottT2SourceVar.set(value= config.get("Hott", "hottT2SourceVar"))
684 jetiVoltageSourceVar.set(value= config.get("Jeti", "jetiVoltageSourceVar"))
685 jetiTemperatureSourceVar.set(value= config.get("Jeti", "jetiTemperatureSourceVar"))
687 def saveConfig():
688 config.set("Main", "ppmExist", ppmExist.get())
689 config.set("Main", "varioExist", varioExist.get())
690 config.set("Main", "voltageExist", voltageExist.get())
691 config.set("Main", "currentExist", currentExist.get())
692 config.set("Main", "gpsExist", gpsExist.get())
693 config.set("Main", "airspeedExist", airspeedExist.get())
694 config.set("Main", "rpmExist", rpmExist.get())
695 config.set("Main", "imuExist", imuExist.get())
696 config.set("Main", "magnetExist", magnetExist.get())
697 config.set("Main", "flowExist", flowExist.get())
698 config.set("Main", "adcExist", adcExist.get())
699 config.set("Main", "sequenceExist", sequenceExist.get())
700 config.set("Main", "persistentExist", persistentExist.get())
702 config.set("Main", "addFieldsExist", addFieldsExist.get())
703 config.set("Main", "protocolVar", protocolVar.get())
705 config.set("Ppm", "ppmTypeVar", ppmTypeVar.get())
706 config.set("Ppm", "ppmPinVar", str(ppmPinVar.get()))
707 config.set("Ppm", "ppmForMin100Var", str(ppmForMin100Var.get()))
708 config.set("Ppm", "ppmForPlus100Var", str(ppmForPlus100Var.get()))
710 config.set("Imu", "imuPinVar", str(imuPinVar.get()))
711 config.set("Imu", "imuDisplayOffset", imuDisplayOffset.get())
712 config.set("Imu", "imuOffsetXVar", str(imuOffsetXVar.get()))
713 config.set("Imu", "imuOffsetYVar", str(imuOffsetYVar.get()))
714 config.set("Imu", "imuOffsetZVar", str(imuOffsetZVar.get()))
716 config.set("Magnet", "GeneratemagCalData", GeneratemagCalData.get())
717 config.set("Magnet", "xMagOffsetVar", str(xMagOffsetVar.get()))
718 config.set("Magnet", "yMagOffsetVar", str(yMagOffsetVar.get()))
719 config.set("Magnet", "zMagOffsetVar", str(zMagOffsetVar.get()))
720 config.set("Magnet", "xxMagCorrectionVar", str(xxMagCorrectionVar.get()))
721 config.set("Magnet", "xyMagCorrectionVar", str(xyMagCorrectionVar.get()))
722 config.set("Magnet", "xzMagCorrectionVar", str(xzMagCorrectionVar.get()))
723 config.set("Magnet", "yxMagCorrectionVar", str(xxMagCorrectionVar.get()))
724 config.set("Magnet", "yyMagCorrectionVar", str(yyMagCorrectionVar.get()))
725 config.set("Magnet", "yzMagCorrectionVar", str(yzMagCorrectionVar.get()))
726 config.set("Magnet", "zxMagCorrectionVar", str(zxMagCorrectionVar.get()))
727 config.set("Magnet", "zyMagCorrectionVar", str(zyMagCorrectionVar.get()))
728 config.set("Magnet", "zzMagCorrectionVar", str(zzMagCorrectionVar.get()))
730 config.set("Memory", "pushButtPinVar", str(pushButtPinVar.get()))
732 config.set("Vario", "varioTypeVar", varioTypeVar.get())
733 config.set("Vario", "secondBaroExist", secondBaroExist.get())
734 config.set("Vario", "varioSourceVar", varioSourceVar.get())
735 config.set("Vario", "varioHysteresisVar", str(varioHysteresisVar.get()))
736 config.set("Vario", "analogVarioExist", analogVarioExist.get())
737 config.set("Vario", "varioAnalogPinVar", varioAnalogPinVar.get())
738 config.set("Vario", "varioAnalogMinVar", str(varioAnalogMinVar.get()))
739 config.set("Vario", "varioAnalogMaxVar", str(varioAnalogMaxVar.get()))
741 config.set("Airspeed", "airspeedTypeVar", airspeedTypeVar.get())
742 config.set("Airspeed", "airspeedAtSea15CVar", airspeedAtSea15CVar.get())
743 config.set("Airspeed", "airspeedInKmhVar", airspeedInKmhVar.get())
744 config.set("Airspeed", "airspeedResetAtPpmVar", str(airspeedResetAtPpmVar.get()))
745 config.set("Airspeed", "airspeedCompMinAtPpmVar", str(airspeedCompMinAtPpmVar.get()))
746 config.set("Airspeed", "airspeedCompMaxAtPpmVar", str(airspeedCompMaxAtPpmVar.get()))
747 config.set("Airspeed", "airspeedCompMinVar", str(airspeedCompMinVar.get()))
748 config.set("Airspeed", "airspeedCompMaxVar", str(airspeedCompMaxVar.get()))
750 config.set("Voltage", "volt1Exist", volt1Exist.get())
751 config.set("Voltage", "volt2Exist", volt2Exist.get())
752 config.set("Voltage", "volt3Exist", volt3Exist.get())
753 config.set("Voltage", "volt4Exist", volt4Exist.get())
754 config.set("Voltage", "volt5Exist", volt5Exist.get())
755 config.set("Voltage", "volt6Exist", volt6Exist.get())
756 config.set("Voltage", "volt1PinVar", volt1PinVar.get())
757 config.set("Voltage", "volt2PinVar", volt2PinVar.get())
758 config.set("Voltage", "volt3PinVar", volt3PinVar.get())
759 config.set("Voltage", "volt4PinVar", volt4PinVar.get())
760 config.set("Voltage", "volt5PinVar", volt5PinVar.get())
761 config.set("Voltage", "volt6PinVar", volt6PinVar.get())
762 config.set("Voltage", "volt1RgVar", str(volt1RgVar.get()))
763 config.set("Voltage", "volt2RgVar", str(volt2RgVar.get()))
764 config.set("Voltage", "volt3RgVar", str(volt3RgVar.get()))
765 config.set("Voltage", "volt4RgVar", str(volt4RgVar.get()))
766 config.set("Voltage", "volt5RgVar", str(volt5RgVar.get()))
767 config.set("Voltage", "volt6RgVar", str(volt6RgVar.get()))
768 config.set("Voltage", "volt1RvVar", str(volt1RvVar.get()))
769 config.set("Voltage", "volt2RvVar", str(volt2RvVar.get()))
770 config.set("Voltage", "volt3RvVar", str(volt3RvVar.get()))
771 config.set("Voltage", "volt4RvVar", str(volt4RvVar.get()))
772 config.set("Voltage", "volt5RvVar", str(volt5RvVar.get()))
773 config.set("Voltage", "volt6RvVar", str(volt6RvVar.get()))
774 config.set("Voltage", "volt1ScaleVar", str(volt1ScaleVar.get()))
775 config.set("Voltage", "volt2ScaleVar", str(volt2ScaleVar.get()))
776 config.set("Voltage", "volt3ScaleVar", str(volt3ScaleVar.get()))
777 config.set("Voltage", "volt4ScaleVar", str(volt4ScaleVar.get()))
778 config.set("Voltage", "volt5ScaleVar", str(volt5ScaleVar.get()))
779 config.set("Voltage", "volt6ScaleVar", str(volt6ScaleVar.get()))
780 config.set("Voltage", "volt1OffsetVar", str(volt1OffsetVar.get()))
781 config.set("Voltage", "volt2OffsetVar", str(volt2OffsetVar.get()))
782 config.set("Voltage", "volt3OffsetVar", str(volt3OffsetVar.get()))
783 config.set("Voltage", "volt4OffsetVar", str(volt4OffsetVar.get()))
784 config.set("Voltage", "volt5OffsetVar", str(volt5OffsetVar.get()))
785 config.set("Voltage", "volt6OffsetVar", str(volt6OffsetVar.get()))
786 config.set("Voltage", "voltReferenceVar", voltReferenceVar.get())
787 config.set("Voltage", "voltRefValueVar", str(voltRefValueVar.get()))
789 config.set("Current", "currentPinVar", currentPinVar.get())
790 config.set("Current", "currentMvoltAt0Var", str(currentMvoltAt0Var.get()))
791 config.set("Current", "currentMvoltPerAmpVar", str(currentMvoltPerAmpVar.get()))
792 config.set("Current", "currentRgVar", str(currentRgVar.get()))
793 config.set("Current", "currentRcVar", str(currentRcVar.get()))
795 config.set("Flow", "flowPulsesmlVar", str(flowPulsesmlVar.get()))
796 config.set("Flow", "flowTankCapVar", str(flowTankCapVar.get()))
797 config.set("Flow", "flowL1ValueVar", str(flowL1ValueVar.get()))
798 config.set("Flow", "flowL1CorrVar", str(flowL1CorrVar.get()))
799 config.set("Flow", "flowL2ValueVar", str(flowL2ValueVar.get()))
800 config.set("Flow", "flowL2CorrVar", str(flowL2CorrVar.get()))
801 config.set("Flow", "flowL3ValueVar", str(flowL3ValueVar.get()))
802 config.set("Flow", "flowL3CorrVar", str(flowL3CorrVar.get()))
803 config.set("Flow", "flowL4ValueVar", str(flowL4ValueVar.get()))
804 config.set("Flow", "flowL4CorrVar", str(flowL4CorrVar.get()))
805 config.set("Flow", "flowPPMResetVar", str(flowPPMResetVar.get()))
807 config.set("Rpm", "pulsesPerRotationVar", str(pulsesPerRotationVar.get()))
809 config.set("Ads", "Adc0TypeVar", Adc0TypeVar.get())
810 config.set("Ads", "Adc1TypeVar", Adc1TypeVar.get())
811 config.set("Ads", "Adc2TypeVar", Adc2TypeVar.get())
812 config.set("Ads", "Adc3TypeVar", Adc3TypeVar.get())
813 config.set("Ads", "Adc0FsVar", Adc0FsVar.get())
814 config.set("Ads", "Adc1FsVar", Adc1FsVar.get())
815 config.set("Ads", "Adc2FsVar", Adc2FsVar.get())
816 config.set("Ads", "Adc3FsVar", Adc3FsVar.get())
817 config.set("Ads", "Adc0OffVar", str(Adc0OffVar.get()))
818 config.set("Ads", "Adc1OffVar", str(Adc1OffVar.get()))
819 config.set("Ads", "Adc2OffVar", str(Adc2OffVar.get()))
820 config.set("Ads", "Adc3OffVar", str(Adc3OffVar.get()))
821 config.set("Ads", "Adc0ScVar", str(Adc0ScVar.get()))
822 config.set("Ads", "Adc1ScVar", str(Adc1ScVar.get()))
823 config.set("Ads", "Adc2ScVar", str(Adc2ScVar.get()))
824 config.set("Ads", "Adc3ScVar", str(Adc3ScVar.get()))
825 config.set("Ads", "Adc0CrVar", Adc0CrVar.get())
826 config.set("Ads", "Adc1CrVar", Adc1CrVar.get())
827 config.set("Ads", "Adc2CrVar", Adc2CrVar.get())
828 config.set("Ads", "Adc3CrVar", Adc3CrVar.get())
829 config.set("Ads", "Adc0AvgVar", str(Adc0AvgVar.get()))
830 config.set("Ads", "Adc1AvgVar", str(Adc1AvgVar.get()))
831 config.set("Ads", "Adc2AvgVar", str(Adc2AvgVar.get()))
832 config.set("Ads", "Adc3AvgVar", str(Adc3AvgVar.get()))
833 config.set("Ads", "AdcCurrVar", AdcCurrVar.get())
834 config.set("Ads", "AdcSpVar", AdcSpVar.get())
836 config.set("Gps", "gps3dExist", gps3dExist.get())
837 config.set("Gps", "gpsTimeExist", gpsTimeExist.get())
838 config.set("Gps", "gpsRateVar", gpsRateVar.get())
840 config.set("AddFields", "fillTest1VarioTemperatureVar", fillTest1VarioTemperatureVar.get())
841 config.set("AddFields", "fillTest2VarioTemperatureVar", fillTest2VarioTemperatureVar.get())
842 config.set("AddFields", "fillTest3VarioTemperatureVar", fillTest3VarioTemperatureVar.get())
843 config.set("AddFields", "fillTest3ExpectedAltitudeVar", fillTest3ExpectedAltitudeVar.get())
844 config.set("AddFields", "expAltTimeVar", str(expAltTimeVar.get()))
845 config.set("AddFields", "fillTest123LinearAccVar", fillTest123LinearAccVar.get())
846 config.set("AddFields", "fillTest12VspeedAltVar", fillTest12VspeedAltVar.get())
847 config.set("AddFields", "fillTest1DteVar", fillTest1DteVar.get())
848 config.set("AddFields", "fillTest2PpmAirspeedCompVar", fillTest2PpmAirspeedCompVar.get())
849 config.set("AddFields", "fillTest1YawRateVar", fillTest1YawRateVar.get())
850 config.set("AddFields", "fillTest1HeadingVar", fillTest1HeadingVar.get())
851 config.set("AddFields", "fillTest123FlowVar", fillTest123FlowVar.get())
852 config.set("AddFields", "fillTest1GpsNbrSatVar", fillTest1GpsNbrSatVar.get())
853 config.set("AddFields", "fillTest2GpsHdopVar", fillTest2GpsHdopVar.get())
855 config.set("Frsky", "frskyVfasVar", frskyVfasVar.get())
856 config.set("Frsky", "frskyFuelVar", frskyFuelVar.get())
857 config.set("Frsky", "frskyA3Var", frskyA3Var.get())
858 config.set("Frsky", "frskyA4Var", frskyA4Var.get())
859 config.set("Frsky", "frskyAccxVar", frskyAccxVar.get())
860 config.set("Frsky", "frskyAccyVar", frskyAccyVar.get())
861 config.set("Frsky", "frskyAcczVar", frskyAcczVar.get())
862 config.set("Frsky", "frskyT1Var", frskyT1Var.get())
863 config.set("Frsky", "frskyT2Var", frskyT2Var.get())
865 config.set("Multiplex", "multiplexLine1Var", multiplexLine1Var.get())
866 config.set("Multiplex", "multiplexLine2Var", multiplexLine2Var.get())
867 config.set("Multiplex", "multiplexLine3Var", multiplexLine3Var.get())
868 config.set("Multiplex", "multiplexLine4Var", multiplexLine4Var.get())
869 config.set("Multiplex", "multiplexLine5Var", multiplexLine5Var.get())
870 config.set("Multiplex", "multiplexLine6Var", multiplexLine6Var.get())
871 config.set("Multiplex", "multiplexLine7Var", multiplexLine7Var.get())
872 config.set("Multiplex", "multiplexLine8Var", multiplexLine8Var.get())
873 config.set("Multiplex", "multiplexLine9Var", multiplexLine9Var.get())
875 config.set("Hott", "hottBattery1SourceVar", hottBattery1SourceVar.get())
876 config.set("Hott", "hottBattery2SourceVar", hottBattery2SourceVar.get())
877 config.set("Hott", "hottCellUndervoltageVar", str(hottCellUndervoltageVar.get()))
878 config.set("Hott", "hottMainBatterySourceVar", hottMainBatterySourceVar.get())
879 config.set("Hott", "hottT1SourceVar", hottT1SourceVar.get())
880 config.set("Hott", "hottT2SourceVar", hottT2SourceVar.get())
882 config.set("Jeti", "jetiVoltageSourceVar", jetiVoltageSourceVar.get())
883 config.set("Jeti", "jetiTemperatureSourceVar", jetiTemperatureSourceVar.get())
885 configSaveFileName = filedialog.asksaveasfilename(title="Save as...", defaultextension="*.ini",\
886 filetypes=[("Ini files","*.ini"),("All files", "*")], initialfile=configUploadFileName)
887 print(configSaveFileName)
888 config.write(open(configSaveFileName ,'w'))
889 #configUploadFileName = configSaveFileName
890 #config.write(open('config.ini','w'))
892 def protocolChanged(*arg):
893 #print(protocolVar.get() )
894 nb.tab(15, state="hidden")
895 nb.tab(16, state="hidden")
896 nb.tab(17, state="hidden")
897 nb.tab(18, state="hidden")
898 if protocolVar.get() == "FRSKY_SPORT" or protocolVar.get() == "FRSKY_HUB" or protocolVar.get() == "FRSKY_SPORT_HUB" :
899 nb.tab(15, state="normal")
900 elif protocolVar.get() == "JETI":
901 nb.tab(16, state="normal")
902 elif protocolVar.get() == "HOTT":
903 nb.tab(17, state="normal")
904 elif protocolVar.get() == "MULTIPLEX":
905 nb.tab(18, state="normal")
907 def ppmChanged():
908 if ppmExist.get() == 'On':
909 nb.tab(1, state="normal")
910 else:
911 nb.tab(1, state="hidden")
912 def ppmTypeChanged(*arg):
913 if ppmTypeVar.get() == 'Rx chanel':
914 fPpmType.grid(row=8)
915 else:
916 fPpmType.grid_remove()
917 def varioChanged():
918 if varioExist.get() == 'On':
919 nb.tab(2, state="normal")
920 else:
921 nb.tab(2, state="hidden")
922 def voltageChanged():
923 if voltageExist.get() == 'On':
924 nb.tab(3, state="normal")
925 else:
926 nb.tab(3, state="hidden")
927 def currentChanged():
928 if currentExist.get() == 'On':
929 nb.tab(4, state="normal")
930 else:
931 nb.tab(4, state="hidden")
932 def gpsChanged():
933 if gpsExist.get() == 'On':
934 nb.tab(5, state="normal")
935 else:
936 nb.tab(5, state="hidden")
937 def airspeedChanged():
938 if airspeedExist.get() == 'On':
939 nb.tab(6, state="normal")
940 else:
941 nb.tab(6, state="hidden")
942 def rpmChanged():
943 if rpmExist.get() == 'On':
944 nb.tab(7, state="normal")
945 else:
946 nb.tab(7, state="hidden")
947 def imuChanged():
948 if imuExist.get() == 'On':
949 nb.tab(8, state="normal")
950 else:
951 nb.tab(8, state="hidden")
952 def magnetChanged():
953 if magnetExist.get() == 'On':
954 nb.tab(9, state="normal")
955 else:
956 nb.tab(9, state="hidden")
957 def flowChanged():
958 if flowExist.get() == 'On':
959 nb.tab(10, state="normal")
960 else:
961 nb.tab(10, state="hidden")
962 def adcChanged():
963 if adcExist.get() == 'On':
964 nb.tab(11, state="normal")
965 else:
966 nb.tab(11, state="hidden")
967 def locatorChanged():
968 if locatorExist.get() == 'On':
969 nb.tab(12, state="normal")
970 else:
971 nb.tab(12, state="hidden")
972 def sequenceChanged():
973 if sequenceExist.get() == 'On':
974 nb.tab(13, state="normal")
975 else:
976 nb.tab(13, state="hidden")
977 def persistentChanged():
978 if persistentExist.get() == 'On':
979 nb.tab(14, state="normal")
980 else:
981 nb.tab(14, state="hidden")
982 def addFieldsChanged():
983 if addFieldsExist.get() == 'On':
984 nb.tab(15, state="normal")
985 else:
986 nb.tab(15, state="hidden")
988 def fillTest3ExpectedAltitudeChanged():
989 if fillTest3ExpectedAltitudeVar.get() == 'On':
990 fFillTest3ExpectedAltitude.grid(row=4)
991 else:
992 fFillTest3ExpectedAltitude.grid_remove()
993 def analogVarioChanged():
994 if analogVarioExist.get() == 'On':
995 fAnalogVario.grid(row=8)
996 else:
997 fAnalogVario.grid_remove()
1000 root = Tk()
1001 root.title("openXsensor configurator V1.0.4")
1002 nb = ttk.Notebook(root)
1003 nb.enable_traversal()
1004 fMain = ttk.Frame(nb)
1005 fPpm = ttk.Frame(nb) # page 1
1006 fVario = ttk.Frame(nb) # page 2
1007 fVoltage = ttk.Frame(nb) # page 3
1008 fCurrent = ttk.Frame(nb) # page 4
1009 fGps = ttk.Frame(nb) # page 5
1010 fAirspeed = ttk.Frame(nb) # page 6
1011 fRpm = ttk.Frame(nb) # page 7
1012 fImu = ttk.Frame(nb) # page 8
1013 fMagnet = ttk.Frame(nb) # page 9
1014 fFlow = ttk.Frame(nb) # page 10
1015 fAdc = ttk.Frame(nb) # page 11
1016 fLocator = ttk.Frame(nb) # page 12
1017 fSequence = ttk.Frame(nb) # page 13
1018 fMemory = ttk.Frame(nb) # page 14
1019 fAddFields = ttk.Frame(nb) # page 15
1020 fFrsky = ttk.Frame(nb) # page 16
1021 fJeti = ttk.Frame(nb) # page 17
1022 fHott = ttk.Frame(nb) # page 18
1023 fMultiplex = ttk.Frame(nb) # page 19
1025 ppmExist = StringVar(value='Off')
1026 varioExist = StringVar(value='Off')
1027 voltageExist = StringVar(value='Off')
1028 currentExist = StringVar(value='Off')
1029 gpsExist = StringVar(value='Off')
1030 airspeedExist = StringVar(value='Off')
1031 rpmExist = StringVar(value='Off')
1032 imuExist = StringVar(value='Off')
1033 magnetExist = StringVar(value='Off')
1034 flowExist = StringVar(value='Off')
1035 locatorExist = StringVar(value='Off')
1036 persistentExist = StringVar(value='Off')
1037 adcExist = StringVar(value='Off')
1038 sequenceExist = StringVar(value='Off')
1039 addFieldsExist = StringVar(value='Off')
1041 fPpmType = ttk.Frame(fPpm)
1042 ppmTypeVar = StringVar(value='Rx chanel')
1043 ppmPinVar = IntVar(value = 2)
1044 ppmForMin100Var = IntVar(value = 1000)
1045 ppmForPlus100Var = IntVar(value = 2000)
1047 imuPinVar = IntVar(value = 3)
1048 imuDisplayOffset = StringVar(value='Off')
1049 imuOffsetXVar = IntVar(value=0)
1050 imuOffsetYVar = IntVar(value=0)
1051 imuOffsetZVar = IntVar(value=0)
1053 flowPulsesmlVar = IntVar(value = 10)
1054 flowTankCapVar = IntVar(value = 1000)
1055 flowL1ValueVar = IntVar(value = 0)
1056 flowL1CorrVar = IntVar(value = 0)
1057 flowL2ValueVar = IntVar(value = 0)
1058 flowL2CorrVar = IntVar(value = 0)
1059 flowL3ValueVar = IntVar(value = 0)
1060 flowL3CorrVar = IntVar(value = 0)
1061 flowL4ValueVar = IntVar(value = 0)
1062 flowL4CorrVar = IntVar(value = 0)
1063 flowPPMResetVar = IntVar(value = 95)
1065 pushButtPinVar = IntVar(value = 10)
1067 GeneratemagCalData = StringVar(value='Off')
1068 xMagOffsetVar= IntVar(value=0)
1069 yMagOffsetVar= IntVar(value=0)
1070 zMagOffsetVar= IntVar(value=0)
1071 xxMagCorrectionVar = DoubleVar(value=0)
1072 xyMagCorrectionVar = DoubleVar(value=0)
1073 xzMagCorrectionVar = DoubleVar(value=0)
1074 yxMagCorrectionVar = DoubleVar(value=0)
1075 yyMagCorrectionVar = DoubleVar(value=0)
1076 yzMagCorrectionVar = DoubleVar(value=0)
1077 zxMagCorrectionVar = DoubleVar(value=0)
1078 zyMagCorrectionVar = DoubleVar(value=0)
1079 zzMagCorrectionVar = DoubleVar(value=0)
1081 varioTypeVar = StringVar(value='MS5611')
1083 secondBaroExist = StringVar(value='Off')
1084 varioSourceVar = StringVar(value='FIRST_BARO')
1085 varioHysteresisVar = IntVar(value=5)
1088 fAnalogVario = ttk.Frame(fVario)
1089 analogVarioExist = StringVar(value='Off')
1090 varioAnalogPinVar = StringVar(value='3')
1091 varioAnalogMinVar = DoubleVar(value=-3)
1092 varioAnalogMaxVar = DoubleVar(value=3)
1094 airspeedTypeVar = StringVar(value='MS4525')
1095 airspeedAtSea15CVar = StringVar(value='Off')
1096 airspeedInKmhVar = StringVar(value='Off')
1097 airspeedResetAtPpmVar = IntVar(value=100)
1098 airspeedCompMinAtPpmVar = IntVar(value=60)
1099 airspeedCompMaxAtPpmVar = IntVar(value=90)
1100 airspeedCompMinVar = IntVar(value=80)
1101 airspeedCompMaxVar = IntVar(value=140)
1103 Adc0TypeVar= StringVar(value='ADS_OFF')
1104 Adc1TypeVar= StringVar(value='ADS_OFF')
1105 Adc2TypeVar= StringVar(value='ADS_OFF')
1106 Adc3TypeVar= StringVar(value='ADS_OFF')
1107 Adc0FsVar= StringVar(value='MV6144')
1108 Adc1FsVar= StringVar(value='MV6144')
1109 Adc2FsVar= StringVar(value='MV6144')
1110 Adc3FsVar= StringVar(value='MV6144')
1111 Adc0OffVar = IntVar(value=0)
1112 Adc1OffVar = IntVar(value=0)
1113 Adc2OffVar = IntVar(value=0)
1114 Adc3OffVar = IntVar(value=0)
1115 Adc0ScVar = DoubleVar(value=1)
1116 Adc1ScVar = DoubleVar(value=1)
1117 Adc2ScVar = DoubleVar(value=1)
1118 Adc3ScVar = DoubleVar(value=1)
1119 Adc0CrVar= StringVar(value='MS2')
1120 Adc1CrVar= StringVar(value='MS2')
1121 Adc2CrVar= StringVar(value='MS2')
1122 Adc3CrVar= StringVar(value='MS2')
1123 Adc0AvgVar = IntVar(value=10)
1124 Adc1AvgVar = IntVar(value=10)
1125 Adc2AvgVar = IntVar(value=10)
1126 Adc3AvgVar = IntVar(value=10)
1127 AdcCurrVar = StringVar(value='NO')
1128 AdcSpVar = StringVar(value='NO')
1130 volt1Exist = StringVar(value='Off')
1131 volt2Exist = StringVar(value='Off')
1132 volt3Exist = StringVar(value='Off')
1133 volt4Exist = StringVar(value='Off')
1134 volt5Exist = StringVar(value='Off')
1135 volt6Exist = StringVar(value='Off')
1136 volt1PinVar = StringVar(value='0')
1137 volt2PinVar = StringVar(value='1')
1138 volt3PinVar = StringVar(value='2')
1139 volt4PinVar = StringVar(value='3')
1140 volt5PinVar = StringVar(value='6')
1141 volt6PinVar = StringVar(value='7')
1143 volt1RgVar = DoubleVar(value='0.0')
1144 volt2RgVar = DoubleVar(value='0.0')
1145 volt3RgVar = DoubleVar(value='0.0')
1146 volt4RgVar = DoubleVar(value='0.0')
1147 volt5RgVar = DoubleVar(value='0.0')
1148 volt6RgVar = DoubleVar(value='0.0')
1150 volt1RvVar = DoubleVar(value='0.0')
1151 volt2RvVar = DoubleVar(value='0.0')
1152 volt3RvVar = DoubleVar(value='0.0')
1153 volt4RvVar = DoubleVar(value='0.0')
1154 volt5RvVar = DoubleVar(value='0.0')
1155 volt6RvVar = DoubleVar(value='0.0')
1157 volt1ScaleVar = DoubleVar(value='1.0')
1158 volt2ScaleVar = DoubleVar(value='1.0')
1159 volt3ScaleVar = DoubleVar(value='1.0')
1160 volt4ScaleVar = DoubleVar(value='1.0')
1161 volt5ScaleVar = DoubleVar(value='1.0')
1162 volt6ScaleVar = DoubleVar(value='1.0')
1164 volt1OffsetVar = DoubleVar(value='0.0')
1165 volt2OffsetVar = DoubleVar(value='0.0')
1166 volt3OffsetVar = DoubleVar(value='0.0')
1167 volt4OffsetVar = DoubleVar(value='0.0')
1168 volt5OffsetVar = DoubleVar(value='0.0')
1169 volt6OffsetVar = DoubleVar(value='0.0')
1171 voltNumberOfCellsVar = StringVar(value='0')
1172 voltReferenceVar = StringVar(value='Internal')
1173 voltRefValueVar = IntVar(value='5000')
1175 currentPinVar = StringVar(value='0')
1176 currentMvoltAt0Var = DoubleVar(value='0.0')
1177 currentMvoltPerAmpVar = DoubleVar(value='0.0')
1178 currentRgVar = DoubleVar(value='0.0')
1179 currentRcVar = DoubleVar(value='0.0')
1181 pulsesPerRotationVar = IntVar(value=2)
1183 pushButtonPin=StringVar(value='10')
1185 gps3dExist = StringVar(value='Off')
1186 gpsTimeExist = StringVar(value='Off')
1187 gpsRateVar = StringVar(value='5')
1189 SeqUnitVar = IntVar(value='1')
1190 SeqMinVoltVar = IntVar(value='0')
1191 SeqMinCellVar = IntVar(value='0')
1192 SeqOut1Var = StringVar(value='0')
1193 SeqOut2Var = StringVar(value='0')
1194 SeqOut3Var = StringVar(value='0')
1195 SeqOut4Var = StringVar(value='0')
1196 SeqOut5Var = StringVar(value='0')
1197 SeqOut6Var = StringVar(value='0')
1198 SeqB5Var = []
1199 SeqB4Var = []
1200 SeqB3Var = []
1201 SeqB2Var = []
1202 SeqB1Var = []
1203 SeqB0Var = []
1204 SeqTVar = []
1206 for x in range(0,100):
1207 SeqB0Var.append(IntVar(value='0'))
1208 SeqB1Var.append(IntVar(value='0'))
1209 SeqB2Var.append(IntVar(value='0'))
1210 SeqB3Var.append(IntVar(value='0'))
1211 SeqB4Var.append(IntVar(value='0'))
1212 SeqB5Var.append(IntVar(value='0'))
1213 SeqTVar.append(StringVar(value=''))
1215 fFillTest3ExpectedAltitude = ttk.Frame(fAddFields)
1216 fillTest3ExpectedAltitudeVar = StringVar(value='Off')
1217 expAltTimeVar = DoubleVar(value='1.5')
1218 fillTest1VarioTemperatureVar = StringVar(value='Off')
1219 fillTest2VarioTemperatureVar = StringVar(value='Off')
1220 fillTest3VarioTemperatureVar = StringVar(value='Off')
1221 fillTest123LinearAccVar = StringVar(value='Off')
1222 fillTest12VspeedAltVar = StringVar(value='Off')
1223 fillTest1DteVar = StringVar(value='Off')
1224 fillTest2PpmAirspeedCompVar = StringVar(value='Off')
1225 fillTest1YawRateVar = StringVar(value='Off')
1226 fillTest1HeadingVar = StringVar(value='Off')
1227 fillTest123FlowVar = StringVar(value='Off')
1228 fillTest1GpsNbrSatVar = StringVar(value='Off')
1229 fillTest2GpsHdopVar = StringVar(value='Off')
1231 protocolVar = StringVar(value='FRSKY_SPORT')
1232 pinToRxVar = StringVar(value='4')
1234 frskyVfasVar= StringVar(value='Not sent')
1235 frskyFuelVar= StringVar(value='Not sent')
1236 frskyA3Var= StringVar(value='Not sent')
1237 frskyA4Var= StringVar(value='Not sent')
1238 frskyAccxVar= StringVar(value='Not sent')
1239 frskyAccyVar= StringVar(value='Not sent')
1240 frskyAcczVar= StringVar(value='Not sent')
1241 frskyT1Var= StringVar(value='Not sent')
1242 frskyT2Var= StringVar(value='Not sent')
1244 multiplexLine1Var = StringVar(value='Not sent')
1245 multiplexLine2Var = StringVar(value='Not sent')
1246 multiplexLine3Var = StringVar(value='Not sent')
1247 multiplexLine4Var = StringVar(value='Not sent')
1248 multiplexLine5Var = StringVar(value='Not sent')
1249 multiplexLine6Var = StringVar(value='Not sent')
1250 multiplexLine7Var = StringVar(value='Not sent')
1251 multiplexLine8Var = StringVar(value='Not sent')
1252 multiplexLine9Var = StringVar(value='Not sent')
1254 hottCellUndervoltageVar = IntVar(value=3300)
1255 hottBattery1SourceVar = StringVar(value='Not sent')
1256 hottBattery2SourceVar = StringVar(value='Not sent')
1257 hottMainBatterySourceVar = StringVar(value='Not sent')
1258 hottT1SourceVar = StringVar(value='Not sent')
1259 hottT2SourceVar = StringVar(value='Not sent')
1261 jetiVoltageSourceVar = StringVar(value='Not sent')
1262 jetiTemperatureSourceVar = StringVar(value='Not sent')